<template>
    <div>
        <el-row :gutter="20">
            <el-col :span="6" :offset="0" v-for="(item, index) in panels" :key="index">
                <el-card shadow="hover" class="border-0">
                    <template #header>
                        <div class="flex justify-between">
                            <span class="text-sm">{{ item.title }}</span>
                            <el-tag :type="item.unitColor" effect="plain">{{ item.unit }}</el-tag>
                        </div>
                    </template>
                    <span class="text-3xl font-bold text-gray-500">{{ item.value }}</span>
                    <el-divider />
                    <div class="flex justify-between text-gray-500 text-sm">
                        <span>{{ item.subTitle }}</span>
                        <span>{{ item.subValue }}</span>
                    </div>
                </el-card>
            </el-col>
        </el-row>
        <index-navs />
        <el-row :gutter="20" class="mt-5">
            <el-col :span="12" :offset="0">
                <index-chart />
            </el-col>
            <el-col :span="12" :offset="0">
                <IndexCard title="店铺及商品提示" tip="店铺及商品提示" :btns="goods" class="mb-3" />
                <IndexCard title="交易提示" tip="需要立即处理的交易订单" :btns="orders" />
            </el-col>
        </el-row>
    </div>
</template>
<script setup>
import { ref } from "vue";
import { sta_frist_list, sta_thrid_list } from "@/axios/sta"
import IndexNavs from "./IndexNavs.vue"
import IndexChart from "./IndexChart.vue"
import IndexCard from './IndexCard.vue'



const panels = ref([])

sta_frist_list().then(res => {
    panels.value = res
})

const goods = ref([])
const orders = ref([])
sta_thrid_list().then(res => {
    console.log('lail')
    console.log(res)
    goods.value = res.goods
    orders.value = res.orders
})

</script>
